#pragma once

#include "IIndexBuffer.h"


class CIndexBuffer: public IIndexBuffer
{
public:
	CIndexBuffer(uint length, bool dynamic);
	virtual ~CIndexBuffer();

	//	IIndexBuffer
	void*	Lock(uint offset, uint size, EIndexBufferLockType lock_type);
	void	Unlock();
	virtual uint	GetSize() const;
	//---

	operator IDirect3DIndexBuffer9* () const;

private:
	IDirect3DIndexBuffer9* m_pIB;
	void* m_pLockData;
	uint	m_length;
	bool	m_bDynamic;
};